<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
	<p:dialog widgetVar="dlgCadAta"
		header="#{message.header_ata_eletronica}" modal="true" width="770"
		draggable="false" style="font-size: 12px;">
		<p:tabView id="tabAta" style="float:left;width:736px;">
			<p:tab title="Cabeçalho">
				<h:form id="formAta">
					<p:panel style="float:left">
						<h:panelGrid columns="4" style="font-size: 13px;">
							<h:outputLabel value="#{message.solicita_filial}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:selectOneMenu
								value="#{ataEletronicaTela.ataEletronica.filialAta.filial}"
								effect="fade" style="font-size: 13px;" required="true"
								requiredMessage="#{message.msg_requerido}(#{message.solicita_filial})">
								<f:selectItem itemLabel="" itemValue="" />
								<f:selectItem itemLabel="Administrativo" itemValue="15" />
								<f:selectItem itemLabel="Capivari" itemValue="02" />
								<f:selectItem itemLabel="Criciúma" itemValue="06" />
								<f:selectItem itemLabel="Içara" itemValue="04" />
								<f:selectItem itemLabel="Içara II" itemValue="16" />
								<f:selectItem itemLabel="Matriz" itemValue="01" />
							</p:selectOneMenu>

							<h:outputLabel value="#{message.label_origem}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:selectOneMenu required="true"
								requiredMessage="#{message.msg_requerido}(#{message.label_origem})"
								value="#{ataEletronicaTela.ataEletronica.origemAta}"
								effect="fade" style="font-size: 13px;">
								<f:selectItem itemLabel="" itemValue="" />
								<f:selectItem itemLabel="#{message.label_reuniao}"
									itemValue="Reunião" />
								<f:selectItem itemLabel="#{message.label_palestra}"
									itemValue="Palestra" />
								<f:selectItem itemLabel="#{message.label_treinamento}"
									itemValue="Treinamento" />
							</p:selectOneMenu>

							<h:outputLabel value="#{message.label_diretoria}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:selectOneMenu required="true"
								requiredMessage="#{message.msg_requerido}(#{message.label_diretoria})"
								value="#{ataEletronicaTela.ataEletronica.diretoriaAta.codigoDiretoria}"
								effect="fade" style="font-size: 13px; width: 180px;">
								<f:selectItem itemLabel="" itemValue="" />
								<f:selectItems value="#{ataEletronicaTela.listaDiretorias}"
									var="dire"
									itemLabel="#{dire.codigoDiretoria} - #{dire.descricaoDiretoria}"
									itemValue="#{dire.codigoDiretoria}" style="font-size: 13px;" />
							</p:selectOneMenu>

							<h:outputLabel value="#{message.label_data}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:calendar locale="pt" size="5" pattern="dd/MM/yy"
								required="true" requiredMessage="#{message.msg_requerido}"
								value="#{ataEletronicaTela.ataEletronica.dataAta}" />

							<h:outputLabel
								value="#{message.label_hora} #{message.label_inicio}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:calendar pattern="HH:mm" timeOnly="true" locale="pt" size="3"
								required="true" requiredMessage="#{message.msg_requerido}"
								value="#{ataEletronicaTela.ataEletronica.horaInicioAta}" />

							<h:outputLabel value="#{message.label_hora} #{message.label_fim}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:calendar pattern="HH:mm" timeOnly="true" locale="pt" size="3"
								required="true" requiredMessage="#{message.msg_requerido}"
								value="#{ataEletronicaTela.ataEletronica.horaFimAta}" />

							<h:outputLabel value="#{message.produto_armazem}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:inputText value="#{ataEletronicaTela.ataEletronica.localAta}"
								required="true" requiredMessage="#{message.msg_requerido}"
								size="30" />

							<h:outputLabel value="#{message.label_assunto}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:inputText
								value="#{ataEletronicaTela.ataEletronica.assuntoAta}" size="30" />

							<h:outputLabel value="#{message.label_responsavel}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:autoComplete minQueryLength="3" var="user" itemValue="#{user}"
								itemLabel="#{user.nome}" size="30" required="true"
								requiredMessage="#{message.msg_requerido}" styleClass="auto_complete_ata"
								value="#{ataEletronicaTela.ataEletronica.listaResponsaveis}"
								multiple="true" effect="fade" converter="usuarioConverter"
								maxResults="5"
								completeMethod="#{ataEletronicaTela.autoCompleteResponsavel}">
							</p:autoComplete>

							<h:outputLabel value="#{message.label_nivel_visua}"
								styleClass="LabelFont" style="margin-left:30px;" />
							<p:selectOneMenu
								value="#{ataEletronicaTela.ataEletronica.nivelAcessoAta}"
								effect="fade" style="font-size: 13px;" required="true"
								requiredMessage="#{message.msg_requerido}(#{message.label_nivel_visua})">
								<f:selectItem itemLabel="Conselho/Diretor" itemValue="1" />
								<f:selectItem itemLabel="Gerente" itemValue="2" />
								<f:selectItem itemLabel="Coordernador/Supervisor" itemValue="3" />
							</p:selectOneMenu>
						</h:panelGrid>
					</p:panel>
					<div style="margin-top: 8px;">
						<h:outputLabel value="Assuntos Abordados" styleClass="LabelFont" />
						<br />
						<p:editor widgetVar="editorCadAta" width="680" height="200"
							value="#{ataEletronicaTela.ataEletronica.assuntosTratadosAta}" />
					</div>
					<div
						style="margin-left: -100px; margin-top: 20px; left: 50%; position: relative; float: left">
						<p:commandButton value="#{message.botao_concluir}"
							icon="ui-icon-disk" style="font-size: 14px;"
							update=":messages,@form,:tabAta:formAtaAcoes"
							actionListener="#{ataEletronicaTela.salvar}" />
						<p:commandButton value="#{message.botao_cancelar}"
							onclick="editorCadAta.clear();dlgCadAta.hide()" global="false"
							icon="ui-icon-close" type="button"
							style="font-size: 14px;margin-left: 20px;" />
					</div>
				</h:form>
			</p:tab>
			<p:tab title="Ações">
				<h:form id="formAtaAcoes">
					<div style="margin-top: 8px">
						<h:panelGrid columns="2" style="font-size: 13px;">
							<h:outputText value="Ações" styleClass="LabelFont" />
							<p:inputTextarea value="#{ataEletronicaTela.acaoAta.acoes}"
								cols="50" id="idAcaoes" />
							<h:outputText value="#{message.label_responsavel}"
								styleClass="LabelFont" />
							<p:autoComplete minQueryLength="3" var="user" itemValue="#{user}"
								itemLabel="#{user.nome}" size="25" required="true"
								requiredMessage="#{message.msg_requerido}"
								value="#{ataEletronicaTela.acaoAta.listaResponsaveis}"
								effect="fade" converter="usuarioConverter" maxResults="5"
								multiple="true"
								completeMethod="#{ataEletronicaTela.autoCompleteResponsavel}">
							</p:autoComplete>
							<h:outputText value="#{message.label_data}"
								styleClass="LabelFont" />
							<p:calendar locale="pt" size="15" pattern="dd/MM/yy"
								value="#{ataEletronicaTela.acaoAta.data}" />
							<h:outputText value="Observação" styleClass="LabelFont" />
							<p:inputText size="15"
								value="#{ataEletronicaTela.acaoAta.status}" />
						</h:panelGrid>
						<br /> <br />
						<p:commandButton value="Adicionar" style="font-size: 14px;"
							update="acoes,:growl,@parent"
							action="#{ataEletronicaTela.reinitAcaoAta}">
							<p:collector value="#{ataEletronicaTela.acaoAta}"
								addTo="#{ataEletronicaTela.listaAcoesAta}" />
						</p:commandButton>
					</div>

					<p:outputPanel id="acoes">
						<p:dataTable value="#{ataEletronicaTela.listaAcoesAta}" var="acao"
							style="overflow: scroll; margin-left: 4em; font-size:11px; margin-top: 30px;"
							emptyMessage="#{message.msg_semvalores}">
							<p:column headerText="Ações" style="width:150px;">
								<h:outputText value="#{acao.acoes}" />
							</p:column>
							<p:column headerText="Responsável" style="width:100px;">
								<h:outputText value="#{acao.responsavel.nome}" />
							</p:column>
							<p:column headerText="Data" style="width:50px;">
								<h:outputText value="#{acao.data}">
									<f:convertDateTime pattern="dd/MM/yy" />
								</h:outputText>
							</p:column>
							<p:column headerText="Observação" style="width:70px;">
								<h:outputText value="#{acao.status}" />
							</p:column>
							<p:column style="width:50px;">
								<p:commandButton update=":tabAta:formAtaAcoes:acoes"
									process=":tabAta:formAtaAcoes:acoes" title="Remover"
									icon="ui-icon-trash">
									<p:collector value="#{acao}"
										removeFrom="#{ataEletronicaTela.listaAcoesAta}" />
								</p:commandButton>
							</p:column>
						</p:dataTable>
					</p:outputPanel>
				</h:form>
			</p:tab>
		</p:tabView>
	</p:dialog>
</h:body>
</html>